function verifySumbit() {
	/*--------*/
	var roleCheckBox = $("#roleCheckBoxSpan").find("input:checkbox");
	var check = null;
	var roleCh = false;
	if ($("#peopleForm\\:userId").val().length == 0) {
		$("#peopleForm\\:userId").next().html("* 用户ID不能够为空！");
		check = $("#peopleForm\\:userId");
	} else {
		$("#peopleForm\\:userId").next().html("*");
	}
	/*----------------*/
	if ($("#peopleForm\\:userName").val().length == 0) {
		$("#peopleForm\\:userName").next().html("* 用户名不能够为空！");
		if (!check)
			check = $("#peopleForm\\:userName");
	} else {
		$("#peopleForm\\:userName").next().html("*");
	}
	/*----------------*/
	if ($("#peopleForm\\:password").val().length == 0) {
		$("#peopleForm\\:password").next().html("* 密码不能够为空！");
		if (!check)
			check = $("#peopleForm\\:password");
	} else {
		$("#peopleForm\\:password").next().html("*");
	}
	/*----------------*/
	if ($("#peopleForm\\:ckpassword").val().length == 0) {
		$("#peopleForm\\:ckpassword").next().html("* 确认密码不能够为空！");
		if (!check)
			check = $("#peopleForm\\:ckpassword");
	} else {
		if ($("#peopleForm\\:password").val() != $("#peopleForm\\:ckpassword")
				.val()) {
			$("#peopleForm\\:ckpassword").next().html("* 确认密码与密码不符合！");
			if (!check)
				check = $("#peopleForm\\:ckpassword");
		} else {
			$("#peopleForm\\:ckpassword").next().html("*");
		}
	}
	/*----------------*/
	/*if ($("#orgname").val().length == 0) {
		$("#orgname").next().next().html("* 所属机构不能够为空！");
		roleCh = true;
	} else {
		$("#orgname").next().next().html("*");
	}
*/
	/*----------------*/

	if (roleCheckBox.length > 0) {
		var rolechecked = "";
		roleCheckBox.each(function(i) {
					if (this.checked)
						rolechecked += this.id + ",";
				});
		if (rolechecked.length == 0) {
			$("#roleCheckBoxSpan").next().html("* 角色不能够为空！");
			roleCh = true;
		} else {
			$("#peopleForm\\:roleChecked").val(rolechecked);
			$("#roleCheckBoxSpan").next().html("*");
		}
	} else {
		$("#roleCheckBoxSpan").next().html("* 角色不能够为空！");
		roleCh = true;
	}
	/*----------------*/
	if ($("#peopleForm\\:phone").val().length == 0) {
		$("#peopleForm\\:phone").next().html(" ");
	} else {
		if (!(/^(0(10|2[0-57-9]|[3-9]\d{2})-)?\d{7,8}(-\d{4})?$/
				.test($("#peopleForm\\:phone").val()))) {
			$("#peopleForm\\:phone").next()
					.html("* 联系电话格式不正确 格式为[区号-]号码[-分机]！[*]:非必填");
			if (!check)
				check = $("#peopleForm\\:phone");
		} else {
			$("#peopleForm\\:phone").next().html(" ");
		}
	}
	/*----------------*/
	if ($("#peopleForm\\:mobile").val().length > 0) {
		if (!(/^1[3|5]\d{9,10}$/.test($("#peopleForm\\:mobile").val()))) {
			$("#peopleForm\\:mobile").next().html("* 手机号码格式不正确 格式为([13|15]********[*])！");
			if (!check)
				check = $("#peopleForm\\:mobile");
		} else {
			$("#peopleForm\\:mobile").next().html(" ");
		}
	} else {
		$("#peopleForm\\:mobile").next().html(" ");
	}
	/*----------------*/
	if ($("#peopleForm\\:email").val().length == 0) {
		$("#peopleForm\\:email").next().html(" ");
	} else {
		if (!(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/
				.test($("#peopleForm\\:email").val()))) {
			$("#peopleForm\\:email").next().html("* 邮箱格式不正确 格式为(*@*.*)！");
			if (!check)
				check = $("#peopleForm\\:email");
		} else {
			$("#peopleForm\\:email").next().html(" ");
		}
	}
	if($("#peopleForm\\:remark").val().length > 100){
		$("#peopleForm\\:remark").next().html("* 备注字符长度不能大于 100!");
		if (!check)
			check = $("#peopleForm\\:remark");
	}else{
		$("#peopleForm\\:remark").next().html(" ");
	}
	
	if (check) {
		check.focus();
		return false;
	} else if (roleCh) {
		return false;
	} else {
		return true;
	}
}


function verifyUpdSumbit() {
	/*--------*/
	var roleCheckBox = $("#roleCheckBoxSpan").find("input:checkbox");
	var check = null;
	var roleCh = false;
	/*----------------*/
	if ($("#peopleForm\\:userName").val().length == 0) {
		$("#peopleForm\\:userName").next().html("* 用户名不能够为空！");
		if (!check)
			check = $("#peopleForm\\:userName");
	} else {
		$("#peopleForm\\:userName").next().html("*");
	}

	if (roleCheckBox.length > 0) {
		var rolechecked = "";
		roleCheckBox.each(function(i) {
					if (this.checked)
						rolechecked += this.id + ",";
				});
		if (rolechecked.length == 0) {
			$("#roleCheckBoxSpan").next().html("* 角色不能够为空！");
			roleCh = true;
		} else {
			$("#peopleForm\\:roleChecked").val(rolechecked);
			$("#roleCheckBoxSpan").next().html("*");
		}
	} else {
		$("#roleCheckBoxSpan").next().html("* 角色不能够为空！");
		roleCh = true;
	}
	/*----------------*/
	if ($("#peopleForm\\:phone").val().length == 0) {
		$("#peopleForm\\:phone").next().html(" ");
	} else {
		if (!(/^(0(10|2[0-57-9]|[3-9]\d{2})-)?\d{7,8}(-\d{4})?$/
				.test($("#peopleForm\\:phone").val()))) {
			$("#peopleForm\\:phone").next()
					.html("* 联系电话格式不正确 格式为[区号-]号码[-分机]！[*]:非必填");
			if (!check)
				check = $("#peopleForm\\:phone");
		} else {
			$("#peopleForm\\:phone").next().html(" ");
		}
	}
	/*----------------*/
	if ($("#peopleForm\\:mobile").val().length > 0) {
		if (!(/^1[3|5]\d{9,10}$/.test($("#peopleForm\\:mobile").val()))) {
			$("#peopleForm\\:mobile").next().html("* 手机号码格式不正确 格式为([13|15]********[*])！");
			if (!check)
				check = $("#peopleForm\\:mobile");
		} else {
			$("#peopleForm\\:mobile").next().html(" ");
		}
	} else {
		$("#peopleForm\\:mobile").next().html(" ");
	}
	/*----------------*/
	if ($("#peopleForm\\:email").val().length == 0) {
		$("#peopleForm\\:email").next().html(" ");
	} else {
		if (!(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/
				.test($("#peopleForm\\:email").val()))) {
			$("#peopleForm\\:email").next().html("* 邮箱格式不正确 格式为(*@*.*)！");
			if (!check)
				check = $("#peopleForm\\:email");
		} else {
			$("#peopleForm\\:email").next().html(" ");
		}
	}
	if($("#peopleForm\\:remark").val().length > 100){
		$("#peopleForm\\:remark").next().html("* 备注字符长度不能大于 100!");
		if (!check)
			check = $("#peopleForm\\:remark");
	}else{
		$("#peopleForm\\:remark").next().html(" ");
	}
	if (check) {
		check.focus();
		return false;
	} else if (roleCh) {
		return false;
	} else {
		return true;
	}
}
// [[id,name,ischeck]] Rolecheckbox
var roleStr = "";
var roles = $("#peopleForm\\:roleCheckbox").val();
if (roles.length > 0) {
	var role = eval("(" + roles + ")");
	for (var i in role) {
		roleStr += "<input type=\"checkbox\" id=\"" + role[i][0] + "\" "
				+ role[i][2] + ">" + role[i][1] + "</input> &nbsp;";
	}
}
$("#roleCheckBoxSpan").html(roleStr);


function openwindowtocenter( url, winName, width, height) 
{
	xposition=0; yposition=0;
	if ((parseInt(navigator.appVersion) >= 4 ))
	{
	  //xposition = (screen.width - width) / 2;
	  xposition = (window.screen.availWidth - width) / 2;
	  yposition = (window.screen.availHeight - height) / 2;
	}
	yposition = 0;
	  theproperty= "width=" + width + "," 
	+ "height=" + height + "," 
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=1,"
	+ "scrollbars=yes,"
	+ "status=0," 
	+ "titlebar=0,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + xposition + "," 
	+ "screeny=" + yposition + "," 
	+ "left=" + xposition + "," 
	+ "top=" + yposition; 
	window.open( url,winName,theproperty );
}


